package semant.secondpass;

import semant.Env;
import syntaxtree.Program;
import syntaxtree.VisitorAdapter;

public final class ProgramHandler extends VisitorAdapter
{
	private Env e;
	
	private ProgramHandler(Env e)
	{
		super();
	
		this.e = e;
	}
	
	public static void secondPass(Env e, Program p)
	{
		ProgramHandler h = new ProgramHandler(e);
		
		p.accept(h);
	}
	
	@Override
	public void visit(Program node)
	{			
		ClassHandler.secondPass(e, node.classList);
		
		ClassHandler.secondPass(e, node.mainClass);
	}
}
